Skip to content

migrate 3 fbcode-only TARGETS dirs with placeholder BUCK siblings (#21066)#21066

Merged
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
bigfootjon:export-D109082045
Jul 22, 2026
Merged

migrate 3 fbcode-only TARGETS dirs with placeholder BUCK siblings (#21066)#21066
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
bigfootjon:export-D109082045

Conversation

@bigfootjon

@bigfootjon bigfootjon commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary:

Chunk 7A of fbcode/executorch TARGETS->BUCK migration. 3 directories where:

  • TARGETS contained substantial fbcode-only build rules
    (fbcode_macros, cpp_library, cpp_unittest, etc.)
  • BUCK was a 4-5-line placeholder (e.g. "empty BUCK file to unblock landing")
  • No targets.bzl existed yet

Same transform as chunk 6: created a new targets.bzl with the original
loads and a define_common_targets(is_fbcode = False) function whose body
opens with if not is_fbcode: return. Overwrote the placeholder BUCK
with a thin caller that loads fbsource_utils.is_fbcode() and calls
define_common_targets(is_fbcode = is_fbcode()).

Directories migrated:

  • exir/dialects/edge/test
  • exir/tests
  • test/end2end

Differential Revision: D109082045

Copilot AI review requested due to automatic review settings July 21, 2026 15:26
@pytorch-bot

pytorch-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21066

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ You can merge normally! (1 Unrelated Failure)

As of commit 68dfcc3 with merge base 7628aa6 (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 21, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@meta-codesync

meta-codesync Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@bigfootjon has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109082045.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the internal fbcode TARGETSBUCK migration by moving fbcode-only build rules into per-directory targets.bzl files behind a define_common_targets(is_fbcode=...) gate, and replacing/adding BUCK files that call into those definitions (or updating existing BUCK files to use migration helpers).

Changes:

  • Added targets.bzl files containing the former TARGETS definitions wrapped in define_common_targets(is_fbcode=False).
  • Replaced placeholder/added BUCK files that load is_fbcode() and invoke define_common_targets(...).
  • Removed legacy TARGETS files from the migrated directories.

Reviewed changes

Copilot reviewed 65 out of 65 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
test/end2end/targets.bzl New gated fbcode-only target definitions migrated from TARGETS.
test/end2end/TARGETS Removed legacy fbcode-only build definitions.
test/end2end/BUCK Replaced placeholder with a thin caller into targets.bzl gated by is_fbcode().
extension/audio/targets.bzl New gated fbcode-only target definitions migrated from TARGETS.
extension/audio/TARGETS Removed legacy fbcode-only build definitions.
extension/audio/BUCK New thin caller into targets.bzl gated by is_fbcode().
exir/verification/targets.bzl New gated fbcode-only target definitions migrated from TARGETS.
exir/verification/TARGETS Removed legacy fbcode-only build definitions.
exir/verification/BUCK New thin caller into targets.bzl gated by is_fbcode().
exir/tests/targets.bzl New gated fbcode-only test/library target definitions migrated from TARGETS.
exir/tests/TARGETS Removed legacy fbcode-only build definitions.
exir/tests/BUCK Replaced placeholder with a thin caller into targets.bzl gated by is_fbcode().
exir/dialects/test/targets.bzl New gated fbcode-only unittest target migrated from TARGETS.
exir/dialects/test/TARGETS Removed legacy fbcode-only build definitions.
exir/dialects/test/BUCK New thin caller into targets.bzl gated by is_fbcode().
exir/dialects/edge/test/targets.bzl New gated fbcode-only unittest targets migrated from TARGETS.
exir/dialects/edge/test/TARGETS Removed legacy fbcode-only build definitions.
exir/dialects/edge/test/BUCK Replaced placeholder with a thin caller into targets.bzl gated by is_fbcode().
exir/dialects/edge/spec/targets.bzl New gated fbcode-only library/binary targets migrated from TARGETS.
exir/dialects/edge/spec/TARGETS Removed legacy fbcode-only build definitions.
exir/dialects/edge/spec/BUCK New thin caller into targets.bzl gated by is_fbcode().
examples/qualcomm/targets.bzl New gated fbcode-only example targets migrated from TARGETS.
examples/qualcomm/TARGETS Removed legacy fbcode-only build definitions.
examples/qualcomm/BUCK New thin caller into targets.bzl gated by is_fbcode().
examples/models/resnet/targets.bzl New gated fbcode-only model target(s) migrated into targets.bzl.
examples/models/resnet/BUCK New thin caller into targets.bzl gated by is_fbcode().
examples/models/qwen3/targets.bzl New gated fbcode-only model target(s) migrated into targets.bzl.
examples/models/qwen3/BUCK New thin caller into targets.bzl gated by is_fbcode().
examples/models/qwen2_5/targets.bzl New gated fbcode-only model target(s) migrated into targets.bzl.
examples/models/qwen2_5/BUCK New thin caller into targets.bzl gated by is_fbcode().
examples/models/phi_4_mini/targets.bzl New gated fbcode-only model + converter binary targets migrated into targets.bzl.
examples/models/phi_4_mini/BUCK New thin caller into targets.bzl gated by is_fbcode().
examples/models/gemma4/tests/targets.bzl New gated fbcode-only test target migrated into targets.bzl.
examples/models/gemma4/tests/BUCK New thin caller into targets.bzl gated by is_fbcode().
examples/llm_pte_finetuning/targets.bzl New gated fbcode-only example targets migrated from TARGETS.
examples/llm_pte_finetuning/TARGETS Removed legacy fbcode-only build definitions.
examples/llm_pte_finetuning/BUCK New thin caller into targets.bzl gated by is_fbcode().
devtools/size_analysis_tool/targets.bzl New gated fbcode-only tool targets migrated from TARGETS.
devtools/size_analysis_tool/TARGETS Removed legacy fbcode-only build definitions.
devtools/size_analysis_tool/BUCK New thin caller into targets.bzl gated by is_fbcode().
devtools/pte_tool/tests/targets.bzl New gated fbcode-only unittest target migrated from TARGETS.
devtools/pte_tool/tests/TARGETS Removed legacy fbcode-only build definitions.
devtools/pte_tool/tests/BUCK New thin caller into targets.bzl gated by is_fbcode().
devtools/intermediate_output_tap/tests/targets.bzl New gated fbcode-only unittest targets migrated from TARGETS.
devtools/intermediate_output_tap/tests/TARGETS Removed legacy fbcode-only build definitions.
devtools/intermediate_output_tap/tests/BUCK New thin caller into targets.bzl gated by is_fbcode().
devtools/inspector/tests/targets.bzl New gated fbcode-only unittest targets migrated from TARGETS.
devtools/inspector/tests/TARGETS Removed legacy fbcode-only build definitions.
devtools/inspector/tests/BUCK New thin caller into targets.bzl gated by is_fbcode().
devtools/backend_debug/tests/targets.bzl New gated fbcode-only unittest target migrated from TARGETS.
devtools/backend_debug/tests/TARGETS Removed legacy fbcode-only build definitions.
devtools/backend_debug/tests/BUCK New thin caller into targets.bzl gated by is_fbcode().
backends/webgpu/test/targets.bzl New gated fbcode-only test/library targets added in targets.bzl.
backends/webgpu/test/BUCK Updated BUCK targets to use the migration helper macro (fbcode_target).
backends/vulkan/_passes/targets.bzl New gated fbcode-only pass-library targets migrated from TARGETS.
backends/vulkan/_passes/TARGETS Removed legacy fbcode-only build definitions.
backends/vulkan/_passes/BUCK New thin caller into targets.bzl gated by is_fbcode().
backends/example/targets.bzl New gated fbcode-only example backend targets migrated from TARGETS.
backends/example/TARGETS Removed legacy fbcode-only build definitions.
backends/example/BUCK New thin caller into targets.bzl gated by is_fbcode().
backends/cortex_m/targets.bzl New gated fbcode-only backend targets added in targets.bzl.
backends/cortex_m/quantizer/targets.bzl New gated fbcode-only quantizer targets migrated from TARGETS.
backends/cortex_m/quantizer/TARGETS Removed legacy fbcode-only build definitions.
backends/cortex_m/quantizer/BUCK New thin caller into targets.bzl gated by is_fbcode().
backends/cortex_m/BUCK Updated BUCK targets to use the migration helper macro (fbcode_target).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +3
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
Comment on lines +20 to +22
"fbsource//third-party/pypi/soundfile:soundfile"
]
)
Comment on lines +1 to +4
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_version")
python_unittest(
name = "test_add",
srcs = [
"ops/add/test_add.py",
Comment thread extension/audio/BUCK
Comment on lines +1 to +2
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl.
load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
load(":targets.bzl", "define_common_targets")

oncall("executorch")
load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
load(":targets.bzl", "define_common_targets")

oncall("executorch")
@meta-codesync meta-codesync Bot changed the title migrate 3 fbcode-only TARGETS dirs with placeholder BUCK siblings migrate 3 fbcode-only TARGETS dirs with placeholder BUCK siblings (#21066) Jul 22, 2026
Copilot AI review requested due to automatic review settings July 22, 2026 15:28
bigfootjon added a commit to bigfootjon/executorch that referenced this pull request Jul 22, 2026
…torch#21066)

Summary:

Chunk 7A of fbcode/executorch TARGETS->BUCK migration. 3 directories where:
  - TARGETS contained substantial fbcode-only build rules
    (`fbcode_macros`, `cpp_library`, `cpp_unittest`, etc.)
  - BUCK was a 4-5-line placeholder (e.g. "empty BUCK file to unblock landing")
  - No targets.bzl existed yet

Same transform as chunk 6: created a new `targets.bzl` with the original
loads and a `define_common_targets(is_fbcode = False)` function whose body
opens with `if not is_fbcode: return`. Overwrote the placeholder BUCK
with a thin caller that loads `fbsource_utils.is_fbcode()` and calls
`define_common_targets(is_fbcode = is_fbcode())`.

Directories migrated:
  - exir/dialects/edge/test
  - exir/tests
  - test/end2end

Differential Revision: D109082045
…torch#21066)

Summary:
Pull Request resolved: pytorch#21066

Chunk 7A of fbcode/executorch TARGETS->BUCK migration. 3 directories where:
  - TARGETS contained substantial fbcode-only build rules
    (`fbcode_macros`, `cpp_library`, `cpp_unittest`, etc.)
  - BUCK was a 4-5-line placeholder (e.g. "empty BUCK file to unblock landing")
  - No targets.bzl existed yet

Same transform as chunk 6: created a new `targets.bzl` with the original
loads and a `define_common_targets(is_fbcode = False)` function whose body
opens with `if not is_fbcode: return`. Overwrote the placeholder BUCK
with a thin caller that loads `fbsource_utils.is_fbcode()` and calls
`define_common_targets(is_fbcode = is_fbcode())`.

Directories migrated:
  - exir/dialects/edge/test
  - exir/tests
  - test/end2end

Differential Revision: D109082045

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread test/end2end/BUCK
Comment on lines +1 to +9
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl.

load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
load(":targets.bzl", "define_common_targets")

oncall("executorch")

define_common_targets(is_fbcode = is_fbcode())
Copilot AI review requested due to automatic review settings July 22, 2026 15:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

test/end2end/BUCK:9

  • # @noautodeps was present in the previous build file but is now missing from the BUCK file. This directive is typically consumed from the build file itself (see e.g. devtools/bundled_program/test/BUCK), so keeping it only inside targets.bzl likely won’t disable autodeps for this directory as intended.
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl.

load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
load(":targets.bzl", "define_common_targets")

oncall("executorch")

define_common_targets(is_fbcode = is_fbcode())

Comment thread test/end2end/targets.bzl
Comment on lines +8 to +11
# @noautodeps



@meta-codesync
meta-codesync Bot merged commit 9eb7b65 into pytorch:main Jul 22, 2026
185 of 187 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants